<?php
class RM_UserCoupons extends RM_Model {
    protected $_name = 'rm_user_coupons';

    function isUsed(RM_Coupons_Row $coupon, RM_User_Row $user){
        $row = $this->fetchAll($this->select()->where('user_id=?', $user->id)->where('coupon_id=?', $coupon->id))->current();
        return ($row !== null);
    }
}